package org.mch.func.file.findcopy;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.mch.biz.ui.BizEvent;
import org.mch.biz.ui.BizPanel;

public class ClientPanel extends BizPanel {
	private static final long serialVersionUID = 1L;
	private JPanel panel;
	private JTextField text_find_path;
	private JButton btn_browse_find;
	private JButton btn_execute;
	private JLabel label;
	private JLabel label_1;
	private JTextField text_copy_path;
	private JButton btn_browse_copy;
	private JScrollPane scrollPane;
	private RSyntaxTextArea text_filename;

	public ClientPanel() {
		initComponents();
	}

	private void initComponents() {
		setLayout(new BorderLayout(0, 0));
		add(getPanel());
	}

	public JPanel getPanel() {
		if (this.panel == null) {
			this.panel = new JPanel();
			panel.setPreferredSize(new Dimension(200, 10));
			panel.setBorder(new LineBorder(new Color(0, 0, 0)));
			this.panel.setLayout(null);
			panel.add(getText_find_path());
			panel.add(getText_copy_path());
			panel.add(getBtn_browse_find());
			panel.add(getBtn_browse_copy());
			panel.add(getBtn_execute());
			panel.add(getLabel_1());
			panel.add(getLabel_1_1());
			panel.add(getScrollPane_1());
		}
		return this.panel;
	}

	protected BizEvent createEvent() {
		return new ClientEvent(this);
	}

	public JTextField getText_find_path() {
		if (text_find_path == null) {
			text_find_path = new JTextField();
			text_find_path.setFont(new Font("宋体", Font.PLAIN, 13));
			text_find_path.setBounds(84, 7, 493, 33);
			text_find_path.setColumns(10);
		}
		return text_find_path;
	}

	public JButton getBtn_browse_find() {
		if (btn_browse_find == null) {
			btn_browse_find = new JButton("");
			btn_browse_find.setIcon(new ImageIcon(ClientPanel.class.getResource("/resource/images/reftext.gif")));
			btn_browse_find.setFont(new Font("宋体", Font.PLAIN, 12));
			btn_browse_find.setBounds(587, 7, 33, 33);
			btn_browse_find.addMouseListener(this.getEvent());
		}
		return btn_browse_find;
	}

	public JButton getBtn_execute() {
		if (btn_execute == null) {
			btn_execute = new JButton("\u6267\u884C");
			btn_execute.setFont(new Font("宋体", Font.PLAIN, 16));
			btn_execute.setMargin(new Insets(2, 2, 2, 2));
			btn_execute.setBounds(10, 89, 72, 33);
			btn_execute.addMouseListener(getEvent());
		}
		return btn_execute;
	}

	public JLabel getLabel_1() {
		if (label == null) {
			label = new JLabel("查找目录：");
			label.setBounds(10, 10, 72, 26);
		}
		return label;
	}

	public JLabel getLabel_1_1() {
		if (label_1 == null) {
			label_1 = new JLabel("复制目录：");
			label_1.setBounds(10, 53, 72, 26);
		}
		return label_1;
	}

	public JTextField getText_copy_path() {
		if (text_copy_path == null) {
			text_copy_path = new JTextField();
			text_copy_path.setFont(new Font("宋体", Font.PLAIN, 13));
			text_copy_path.setColumns(10);
			text_copy_path.setBounds(84, 50, 493, 33);
		}
		return text_copy_path;
	}

	public JButton getBtn_browse_copy() {
		if (btn_browse_copy == null) {
			btn_browse_copy = new JButton("");
			btn_browse_copy.setIcon(new ImageIcon(ClientPanel.class.getResource("/resource/images/reftext.gif")));
			btn_browse_copy.setFont(new Font("宋体", Font.PLAIN, 12));
			btn_browse_copy.setBounds(587, 50, 33, 33);
		}
		return btn_browse_copy;
	}

	public JScrollPane getScrollPane_1() {
		if (scrollPane == null) {
			scrollPane = new JScrollPane();
			scrollPane.setBorder(new TitledBorder(null, "\u590D\u5236\u6587\u4EF6\u5217\u8868", TitledBorder.LEADING, TitledBorder.TOP, null, null));
			scrollPane.setBounds(10, 132, 611, 323);
			scrollPane.setViewportView(getText_filename());
		}
		return scrollPane;
	}

	public RSyntaxTextArea getText_filename() {
		if (text_filename == null) {
			text_filename = new RSyntaxTextArea();
		}
		return text_filename;
	}
}